import http from '@/components/common/tui-request'


//新增会议纪要
export const addMeetingRecord = (projectId,data) => {
	return http.request({
		url: `/meeting-record/addMeetingRecord/${projectId}`,
		data:data,
		method: 'POST',
	});
};

//删除会议纪要
export const deleteMeetingRecord = (id) => {
	return http.request({
		url: `/meeting-record/deleteMeetingRecord?id=${id}`,
		method: 'DELETE',
	});
};

//删除会议纪要附件
export const deleteMeetingRecordFile = (fileId) => {
	return http.request({
		url: `/meeting-record/deleteMeetingRecordFile?fileId=${fileId}`,
		method: 'DELETE',
	});
};

//根据id回显数据
export const getMeetingRecordById = (meetingRecordId) => {
	return http.request({
		url: `/meeting-record/getMeetingRecordById?meetingRecordId=${meetingRecordId}`,
		method: 'GET',
	});
};

//根据id查询详情
export const selectMeetingRecordById = (meetingRecordId) => {
	return http.request({
		url: `/meeting-record/selectMeetingRecordById?meetingRecordId=${meetingRecordId}`,
		method: 'GET',
	});
};

//条件查询列表
export const getMeetingRecordList = (projectId,page,limit) => {
	return http.request({
		url: `/meeting-record/getMeetingRecordList/${projectId}/${page}/${limit}`,
		method: 'GET',
	});
};

//修改会议纪要
export const updateMeetingRecord = (data) => {
	return http.request({
		url: `/meeting-record/updateMeetingRecord`,
    data:data,
		method: 'PUT',
	});
};

//上传附件
export const uploadMeetingRecordFile = (file) => {
	return uni.uploadFile({
		url: 'http://192.168.1.127:8086/meeting-record/uploadMeetingRecordFile',
		filePath: file.objectUrl,
		name: 'files',
		header: {'Authorization': uni.getStorageSync('token')}
	});
};